Release 10.1A: OpenEdge Development:
Java Open Clients
Detaching SDOResultSet objects [extension]
A stateless SDOResultSet can be detached from an AppObject (or SDOAppObject) and re-attached to a specified (not necessarily the same) AppObject. By detaching the ResultSet and releasing the AppObject (disconnecting the AppServer), the Open Client can use and manipulate the ResultSet without holding any resources on the AppServer.
Most of the SDOResultSet methods available on a normal stateless SDOResultSet are available on a detached SDOResultSet. The exceptions are these methods, which require an AppServer connection:
reOpenQuery()— See the "Miscellaneous management methods" section.sendBatch()— See the information onBatchmode in the "Updating SDOResultSet objects" section.sendBatchAndReOpen()— See the information onBatchmode in the "Updating SDOResultSet objects" section.Thus, before calling a method that requires an AppServer connection, you must attach the SDOResultSet to the same or a different AppObject with a connection to the AppServer. Here are the methods that provide this functionality:
The following method detaches from the AppObject that created the ResultSet:
The following method attaches to the AppObject, SubAppObject, or SDOAppObject specified by
ProxyObject:
Note: ProxyGen-generated AppObjects and SubAppObjects, as well as the SDOAppObject proxy, all implement the SDOFactory interface.
The following method returns
trueif the SDOResultSet is attached to an AppObject; otherwise, it returnsfalse:
The following is a typical scenario for using the detaching and attaching functionality:
- The SDOResultSet is created. Because the scrolling mode is
PREFETCH, all the rows are read and returned to the client.- The SDOResultSet is detached from the AppObject.
- The AppObject is released (the AppServer connection closed).
- The client accesses data and possibly calls
startBatch()and updates some data.- The SDOResultSet is attached to another open AppServer connection.
- The client calls
sendBatch()to apply the modifications.The SDOResultSet interface extends the
java.io.Serializableinterface. As a result, a detached SDOResultSet can be stored and retrieved from disk using the standard Java serialization mechanism. It also can be passed by value and returned from methods using remote method invocation (RMI). After being restored from disk or being received through an RMI call, the SDOResultSet can be re-attached to an AppObject using theattachToAppObj()method.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |